<template>
	<view class="container">
		<customNavigation title="事件类型" src="/static/images/nav_icon_back.png" src2="/static/images/nav_icon_logo.png" color="white" background="#32A238"></customNavigation>
		<view style="height: 11vh;"></view>
		
		<view class="rows rowsw" v-if="shortcutList && shortcutList.length !=0 ">
			<view class="level_bloak tct rowsc"
				@click="goWorkList(item.Id)"
				v-for="(item,index) in shortcutList" :key="index">
				<view class="rowsal rowsm tct level_blaak bgff shadow_bottom mrTop20">
					<image mode="aspectFill"
						style="width: 110rpx;height: 110rpx;background-color: #EEEEEE;"
						:src="item.Image">
					</image>
					<view class="fs28 col333">{{item.Title}}</view>
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	import customNavigation from "@/components/custom-navigation.vue"
	export default {
		components:{
			customNavigation
		},
		data() {
			return {
				shortcutList:[],//事件列表
			}
		},
		onLoad() {
			this.login()
		},
		methods:{
			goWorkList(id) {
				uni.navigateTo({
					url:`/pageOne/commonWork/commonWorkLevelList?id=${id}`
				})
			},
			login() {
				let url = `http://120.79.220.26:8096/api/Account/Login`;
				let obj = {
					U_Username:'T02E001',
					U_Password:'T02E001'
				}
				this.$tools.axiosFrom('POST',url,obj).then(res => {
					if(res.Code==200) {
						this.GetShortcut(res.Data)
						// console.log('[登录成功]',res);
						uni.setStorageSync('auth',res.Data)
					}
				})
			},
			//事件类型
			GetShortcut() {
				let url = `http://120.79.220.26:8097/Shortcut/GetShortcut`;
				this.$tools.axiosFrom('POST',url,{
					type:0 //0快捷菜单，1文件夹
				})
				.then(res => {
					console.log('[key:A列表1]',res);
					if(res.Code ==200){
						if(res.Data.code ==0){
							console.log('[key:A列表2]',res.Data.data);
							this.shortcutList = res.Data.data
						}else{
							this.shortcutList = []
						}
					}else{
						this.shortcutList = []
					}
				})
			},
		}
	}
</script>

<style>
	@import url("./oneone.css");
	page {
		background-color: #f5f5f5;
	}
	.level_bloak {
		flex: 0 0 33.33%;
	}
	.level_blaak {
		width: 220rpx;height: 200rpx;
		border-radius: 8rpx;
	}
</style>
